package servlet;

import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Author：毕龙
 * Date: 2023/7/27 15:22
 */
@WebServlet("/sr")
public class ServletResponse1 extends HttpServlet {
    @Override
    public  void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //获取相应的字节流
        ServletOutputStream outputStream = response.getOutputStream();
        outputStream.write("<html><head></head><body>".getBytes());
        outputStream.write("wujiayu".getBytes());
        outputStream.write("<h1>吴佳煜牛逼plus</h1>".getBytes());
        outputStream.write("<div>吴佳煜每天和安慕希草莓味</div>".getBytes());
        outputStream.write("</body></html>".getBytes());
    }
}
